Update changes - #1
Open
vinkent420 wants to merge 118 commits into
Open
Conversation
* added TestCompletionStream test moved completion stream testing to seperate function added NoErrorF fixes nil pointer reference on stream object * update integration test models
* pass openai secret * only run in master branch
* feat: support batches api * update batch_test.go * fix golangci-lint check * fix golangci-lint check * fix tests coverage * fix tests coverage * fix tests coverage * fix tests coverage * fix tests coverage * fix tests coverage * fix tests coverage * fix: create batch api * update batch_test.go * feat: add `CreateBatchWithUploadFile` * feat: add `UploadBatchFile` * optimize variable and type naming * expose `BatchLineItem` interface * update batches const
* Support Tool Resources properties for Threads * Add Chunking Strategy for Threads vector stores
* implement vectore store feature * fix after integration testing * fix golint error * improve test to increare code coverage * fix golint anc code coverage problem * add tool_resource in assistant response * chore: code style * feat: use pagination param * feat: use pagination param * test: use pagination param * test: rm unused code --------- Co-authored-by: Denny Depok <61371551+kodernubie@users.noreply.github.com> Co-authored-by: eric.p <eric.p>
#787) * added ParallelToolCalls to ChatCompletionRequest with helper functions * added tests for coverage * changed ParallelToolCalls to any
…docs (#792) * fix: Updated ThreadMessage struct with latest fields based on OpenAI docs * fix: Reverted FileIDs for backward compatibility of v1
* Add more parameters to support Assistant v2 * Add goimports
* feat: Add GPT-4o Mini model support * feat: Add GPT-4o-2024-08-06 model support
* feat: Support Structured Outputs * feat: Support Structured Outputs * update imports * add integration test * update JSON schema comments
* Unbreak integration tests * Update integration-tests.yml
* feat: Add DeleteMessage function to API client * fix: linter nolint : Deprecated method split function: cognitive complexity 21 * rename func name for unit-test
* feat: add jsonschema.Validate and jsonschema.Unmarshal * fix Sanity check * remove slices.Contains * fix Sanity check * add SchemaWrapper * update api_integration_test.go * update method 'reflectSchema' to support 'omitempty' in JSON tag * add GenerateSchemaForType * update json_test.go * update `Warp` to `Wrap` * fix Sanity check * fix Sanity check * update api_internal_test.go * update README.md * update README.md * remove jsonschema.SchemaWrapper * remove jsonschema.SchemaWrapper * fix Sanity check * optimize code formatting
* depricated model GPT3Ada changed to GPT3Babbage002 * Delete test.mp3
* add custom marshaller, documentation and isolate tests * fix linter * add missing field
* skip json field * backfill some coverage and tests
* fix image api missing filename bug * add test * add test * update test
…r tests (#999) * test: enhance error accumulator and form builder tests, add marshaller tests * test: fix some issue form golangci-lint * test: gofmt form builder test * fix * fix * fix lint
* Add support for Chat Completion Service Tier * Add priority service tier
* support $ref and $defs in JSON Schema * update
* Add unit tests to improve coverage * Fix type assertion checks in tests
* support $ref and $defs in JSON Schema * update * removed root $ref from JSON Schema * Update json.go * Update json_test.go * Update jsonschema/json.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update jsonschema/json.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* support for extra_body parameter for embeddings API * done linting * added unit tests * improved code coverage and removed unnecessary checks * test cleanup * updated body map creation code * code coverage * minor change * updated testcase comment
* test: expand jsonschema coverage * test: fix package name for containsref tests
* Add unit tests for internal test utilities * Fix lint issues in internal tests
* Add GuidedChoice to ChatCompletionRequest * made separate NonOpenAIExtensions * fixed lint issue * renamed struct and removed inline json tag * Update chat.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update chat.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Alex Baranov <677093+sashabaranov@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* add verbosity param to ChatCompletionRequest * edit comment about verbosity
* feat: add Responses API support * docs: add comprehensive Responses API example * docs: simplify Responses API example * test: add Responses API integration coverage * ignore .env * ci: relax Codecov thresholds
* fix(images): send image edit fields * test(images): isolate optional field write failures
…1108) CreateFormFileReader only set Content-Type when the reader satisfied the ContentType() string optional interface. The OpenAI audio endpoints reject the file when that header is missing, so a plain io.Reader passed through CreateTranscription was a 400 from the server. Derive a Content-Type from the filename extension via mime.TypeByExtension, falling back to "application/octet-stream" which is what the stdlib's multipart.Writer.CreateFormFile uses by default. Readers that supply their own ContentType still win. Fixes #1010. Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
The unmarshaler can return a non-nil *ErrorResponse whose Error pointer
is nil: any payload that round-trips through Unmarshal (a buffered
partial frame on context cancel, a stray "{}", etc.) does it. processLines
then wrapped that nil with `fmt.Errorf("error, %w", respErr.Error)` and
the caller saw the famously useless "error, <nil>" message instead of
the actual io.EOF (or whatever the read error was).
Guard on respErr.Error != nil so the original read error gets returned
when there's no real API error to report.
Fixes #1060.
Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
Remove omitempty from the Stream field tag in ChatCompletionRequest and CompletionRequest. Go's omitempty omits false for bool fields, which means non-streaming requests never include "stream": false in the serialized JSON. Some OpenAI-compatible endpoints (proxies, Azure configurations) require the field to be explicitly present. The streaming code path already sets Stream = true explicitly, so this change only affects non-streaming requests, which now correctly emit "stream": false. Fixes #1073
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A similar PR may already be submitted!
Please search among the Pull request before creating one.
If your changes introduce breaking changes, please prefix the title of your pull request with "[BREAKING_CHANGES]". This allows for clear identification of such changes in the 'What's Changed' section on the release page, making it developer-friendly.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request.
Describe the change
Please provide a clear and concise description of the changes you're proposing. Explain what problem it solves or what feature it adds.
Provide OpenAI documentation link
Provide a relevant API doc from https://platform.openai.com/docs/api-reference
Describe your solution
Describe how your changes address the problem or how they add the feature. This should include a brief description of your approach and any new libraries or dependencies you're using.
Tests
Briefly describe how you have tested these changes. If possible — please add integration tests.
Additional context
Add any other context or screenshots or logs about your pull request here. If the pull request relates to an open issue, please link to it.
Issue: #XXXX